package com.fenxiangle.yueding.feature.mine.view.adapter;

import android.text.Html;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fenxiangle.yueding.R;
import com.fenxiangle.yueding.common.util.DateTool;
import com.fenxiangle.yueding.entity.bo.PublishDemandBo;
import com.suozhang.framework.framework.AM;

import butterknife.BindView;

public class PublishDemandAdapter extends BaseQuickAdapter<PublishDemandBo, BaseViewHolder>{

    public PublishDemandAdapter() {
        super(R.layout.item_publish_demand);
    }
    //指示器设置渐变色

    @Override
    protected void convert(BaseViewHolder helper, PublishDemandBo item) {
        AM.image().bindToCircleObject(item.getOwnUserHead(), helper.getView(R.id.iv_my_publish_head));
        helper.setText(R.id.tv_my_publish_title, Html.fromHtml("<b><tt>需求内容：</tt></b>"+ "人数" +item.getNumPeople() + "人。 " +item.getOrderDescribe()))
                .setText(R.id.tv_my_publish_count, "已有"+item.getNumPeopleNow()+"人抢单")
                .setText(R.id.tv_my_publish_address, "地点："+item.getAgreedPlace())
                .setText(R.id.tv_my_publish_job,"职业："+item.getOccupation())
                .setText(R.id.tv_my_publish_date, "时间：" + DateTool.stampToDate(item.getStartTime()) + "——" + DateTool.stampToDate(item.getEndTime()))
                .setText(R.id.tv_my_publish_money,"服务费：￥"+item.getTotalPrice())
                .setText(R.id.tv_my_publish_position,"信用金：￥100")
                .addOnClickListener(R.id.iv_my_publish_head)
                .addOnClickListener(R.id.btn_publis_selected)
                .addOnClickListener(R.id.btn_my_publish_cancle);
    }
}
